{include file="header.htm" /}
<script type="text/javascript" src="__SKIN__/js/clipboard.min.js"></script>
<script type="text/javascript" src="__PUBLIC__/plugins/Echarts/echarts.min.js"></script>
<link href="__WEAPP_TEMPLATE__/skin/css/main_shop.css?v={$weappInfo.version|default='v1.0.0'}" rel="stylesheet" type="text/css">
<body class="bodystyle" style="cursor: default; -moz-user-select: inherit; min-width:400px;">
<div id="append_parent"></div>
<div id="ajaxwaitid"></div>
<div class="page p0 mb10">
    {include file="bar.htm" /}
</div>

<div class="page p0 mb10">
    <div class="ncap-form-default">
        <div class="index_box">
            <div class="real_time_count">
                 <div class="survey_title">
                     <h3 class="fl">佣金概览</h3>
                 </div>
                 <div class="container-fluid list-stats-survey">
                     <ul class="stats6">
                        <li>
                            <div class="card_box">
                                <div class="title-survey">待结算佣金（元）<p class="notic">所有未结算的分销订单佣金总和(包含一级和二级分佣)</p></div>
                                <p><cite>{$toBeSettledMoney}</cite></p>
                            </div>
                        </li>
                        <li>
                            <div class="card_box">
                                <div class="title-survey">已结算佣金（元）<p class="notic">所有已结算的分销订单佣金总和(包含一级和二级分佣)</p></div>
                                <p><cite>{$alreadySettledMoney}</cite></p>
                            </div>
                        </li>
                        <li>
                            <div class="card_box">
                                <div class="title-survey">可提现佣金（元）<p class="notic">所有分销商可用的佣金总和(不包含提现中、已提现佣金)</p></div>
                                <p><cite>{$dealerAvailableMoney}</cite></p>
                            </div>
                        </li>
                        <li>
                            <div class="card_box">
                                <div class="title-survey">提现待审核（元）<p class="notic">所有待审核的分销商提现申请佣金总和</p></div>
                                <p><cite>{$toBeReviewMoney}</cite></p>
                            </div>
                        </li>
                        <li>
                            <div class="card_box">
                                <div class="title-survey">提现待打款（元）<p class="notic">所有已同意但未打款的分销商提现申请佣金总和</p></div>
                                <p><cite>{$toBeHitPayMoney}</cite></p>
                            </div>
                        </li>
                        <li>
                            <div class="card_box">
                                <div class="title-survey">已提现佣金（元）<p class="notic">所有已同意并已打款的分销商提现申请佣金总和</p></div>
                                <p><cite>{$alreadyDealerMoney}</cite></p>
                            </div>
                        </li>
                    </ul>
                 </div>
            </div>
        </div>
    </div>
</div>

<div class="page p0 mb10">
    <div class="ncap-form-default">
        <div class="index_box">
            <div class="real_time_count">
                 <div class="survey_title">
                     <h3 class="fl">分销商概览</h3>
                 </div>
                 <div class="container-fluid list-stats-survey">
                     <ul class="stats6">
                        <li>
                            <div class="card_box">
                                <div class="title-survey">待审核总数（人）<p class="notic"></p></div>
                                <p><cite>{$dealerApply}</cite></p>
                            </div>
                        </li>
                        <li>
                            <div class="card_box">
                                <div class="title-survey">分销商总数（人）<p class="notic"></p></div>
                                <p><cite>{$dealerTotal}</cite></p>
                            </div>
                        </li>
                        <li>
                            <div class="card_box">
                                <div class="title-survey">一级分销商（人）<p class="notic"></p></div>
                                <p><cite>{$dealerOneLevel}</cite></p>
                            </div>
                        </li>
                        <li>
                            <div class="card_box">
                                <div class="title-survey">二级分销商（人）<p class="notic"></p></div>
                                <p><cite>{$dealerTwoLevel}</cite></p>
                            </div>
                        </li>
                        <li>
                            <div class="card_box">
                                <div class="title-survey">分销商客户（人）<p class="notic"></p></div>
                                <p><cite>{$dealerCustomer}</cite></p>
                            </div>
                        </li>
                    </ul>
                 </div>
            </div>
        </div>
    </div>
</div>

<div class="page pb0 mb10">
    <div class="flexigrid">
        <div class="mDiv">
            <div class="ftitle">
                <h3>近七日分销概况</h3>
            </div>
        </div>
        <div class="list-stats">
            <div class="stats-con">
                <div id="stats-box" style="width:90%;height:400px;margin: 0 auto;"></div>
            </div>
        </div>
    </div>
</div>

<script type="text/javascript">
    function getBeforeDate(n) {
        var n = n;
        var d = new Date();
        var year = d.getFullYear();
        var mon = d.getMonth() + 1;
        var day = d.getDate();
        if (day <= n) {
            if (mon > 1) {
                mon = mon - 1;
            } else {
                year = year - 1;
                mon = 12;
            }
        }
        d.setDate(d.getDate() - n);
        year = d.getFullYear();
        mon = d.getMonth() + 1;
        day = d.getDate();
        s = year + "-" + (mon < 10 ? ('0' + mon) : mon) + "-" + (day < 10 ? ('0' + day) : day);
        return s;
    }

    // 基于准备好的dom，初始化echarts实例
    var myChart = echarts.init(document.getElementById('stats-box'));

    // 指定图表的配置项和数据
    var option = {
        color: ['#3398DB', '#6be6c1'],
        title: {
            text: ''
        },
        tooltip: {
            trigger: 'axis',
        },
        legend: {
            data: ['新增分销商', '已结算佣金']
        },
        grid: {
            left: '3%',
            right: '4%',
            bottom: '3%',
            containLabel: true
        },
        toolbox: {
            feature: {
                saveAsImage: {}
            }
        },
        xAxis: {
            type: 'category',
            boundaryGap: false,
            data: [getBeforeDate(6), getBeforeDate(5), getBeforeDate(4), getBeforeDate(3), getBeforeDate(2), getBeforeDate(1), getBeforeDate(0)],
            splitLine: {
                show: true,
                lineStyle: {
                    color: ['#eee'],
                    width: 1,
                    type: 'solid'
                }
            }
        },
        yAxis: {
            type: 'value',
            splitLine: {
                show: true,
                lineStyle: {
                    color: ['#eee'],
                    width: 1,
                    type: 'solid'
                }
            }
        },
        series: [{
                name: '新增分销商',
                type: 'line',
                data: ['{$addDealer.0}','{$addDealer.1}','{$addDealer.2}','{$addDealer.3}','{$addDealer.4}','{$addDealer.5}','{$addDealer.6}'],
            },
            {
                name: '已结算佣金',
                type: 'line',
                data: ['{$settledMoney.0}','{$settledMoney.1}','{$settledMoney.2}','{$settledMoney.3}','{$settledMoney.4}','{$settledMoney.5}','{$settledMoney.6}'],
            },
        ]
    };

    // 使用刚指定的配置项和数据显示图表。
    myChart.setOption(option);
</script>

{include file="footer.htm" /}